//
//  SelectionTableViewCell.m
//  Taste
//
//  Created by 徐昊 on 16/9/2.
//  Copyright © 2016年 徐昊. All rights reserved.
//

#import "SelectionTableViewCell.h"
#import "SelectionRes.h"
#import "UIImageView+WebCache.h"
#import "NSString+Vali.h"

@interface SelectionTableViewCell ()

@property (weak, nonatomic) IBOutlet UILabel *name;
@property (weak, nonatomic) IBOutlet UILabel *shortIntroduce;
@property (weak, nonatomic) IBOutlet UILabel *avPriceShow;
@property (weak, nonatomic) IBOutlet UILabel *colnum;
@property (weak, nonatomic) IBOutlet UILabel *procineName;
@property (weak, nonatomic) IBOutlet UIImageView *image;




@end

@implementation SelectionTableViewCell

- (void)setRes:(SelectionRes *)res {
    _res = res;
    _name.text = _res.name;
    _shortIntroduce.text = _res.shortinstruction;
    _avPriceShow.text = _res.avgpriceshow;
    _colnum.text = [NSString stringWithFormat:@"%ld", _res.colnum];
    _procineName.text = _res.provineName;
    [_image sd_setImageWithURL:[NSURL URLWithString:[NSString imageWebWithStr:_res.pic]] completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
    }];
    _image.contentMode = UIViewContentModeScaleAspectFill;
    _image.clipsToBounds = YES;
}

- (void)awakeFromNib {
    // Initialization code
    [super awakeFromNib];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
